/*
 * Copyright (c) 2021 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "dm_timer.h"

namespace OHOS {
namespace DistributedHardware {
namespace {
const int32_t MILL_SECONDS_PER_SECOND = 1000;
}
DmTimer::DmTimer(const std::string &name)
{
    if (name.empty()) {
        LOGI("DmTimer name is null");
        return;
    }
    
    LOGI("DmTimer %s Construct", name.c_str());
}

DmTimer::~DmTimer()
{
    if (mTimerName_.empty()) {
        LOGI("DmTimer is not init");
        return;
    }
    LOGI("DmTimer %s Destroy in", mTimerName_.c_str());
}

DmTimerStatus DmTimer::Start(uint32_t timeOut, TimeoutHandle handle, void *data)
{
    LOGI("DmTimer start timeout(%d)", timeOut);
    mStatus_ = DmTimerStatus::DM_STATUS_RUNNING;
    return mStatus_;
}

void DmTimer::Stop(int32_t code)
{
    LOGI("DmTimer Stop code (%d)", code);
    return;
}

void DmTimer::WaitForTimeout()
{

}

int32_t DmTimer::CreateTimeFd()
{
    return 0;
}

void DmTimer::Release()
{

}

std::string DmTimer::GetTimerName()
{
    return mTimerName_;
}
} // namespace DistributedHardware
} // namespace OHOS
